package com.visual.launch;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;


public class MainActivity extends Activity {

    ImageButton androidImageButton;
    ImageButton uplayerImageButton;

    final String AML_LAUNCHER_PACKAGE = "com.amlogic.mediaboxlauncher";
    final String UPLAYER_PACKAGE = "com.taiji.uplayer";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        androidImageButton = (ImageButton)findViewById(R.id.main_imgbtn_android);
        androidImageButton.setOnClickListener(androidImageButtonOnClick);

        uplayerImageButton = (ImageButton)findViewById(R.id.main_imgbtn_uplayer);
        uplayerImageButton.setOnClickListener(uplayerImageButtonOnClick);
    }

    View.OnClickListener androidImageButtonOnClick = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //Toast.makeText(MainActivity.this, "启动android桌面",Toast.LENGTH_LONG).show();
            Intent intent = getPackageManager().getLaunchIntentForPackage(AML_LAUNCHER_PACKAGE);
            startActivity(intent);
        }
    };

    View.OnClickListener uplayerImageButtonOnClick = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //Toast.makeText(MainActivity.this, "启动uplayer应用",Toast.LENGTH_LONG).show();
            Intent intent = getPackageManager().getLaunchIntentForPackage(UPLAYER_PACKAGE);
            startActivity(intent);
        }
    };

    @Override
    public void onBackPressed() {
        return;
    }
}
